﻿/*
* 创建人:            @Model.Author
* 创建时间:          @Model.CreateTime
* 邮箱：             @Model.EmailAddress
* 文件功能描述：      @Model.FileRemark
*
* 修改人：
* 时间：
* 修改说明：
*/
@{
    Layout = null;
}
@using System
@using SJNScaffolding.Builders
@model SJNScaffolding.Models.TemplateModels.ViewFileModel
using System;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace @(Model.ProjectName).Domain.Plat.@(Model.TableName)s
{
    public class @Model.TableName : FullAuditedEntity<@(Model.IdType)>
    {
        @if (Model.TypeColumnNames != null)
        {
            foreach (var item in Model.TypeColumnNames)
            {
@("     ///" )<summary>
@Html.Raw($"     ///{item.Comments}")
@("     ///" )</summary>
if (item.IsRequired=="1")
{
@Html.Raw("     [Required(ErrorMessage=\"" + item.Comments + "为必填项\")]\r\n") 
}
if (item.ColumnType.ToLower().Contains("varchar")&&item.DataLength>0)
{
@Html.Raw("     [StringLength(" + item.DataLength + ",ErrorMessage=\"" + item.Comments + "的长度应在" + item.DataLength + "字符以内\")]\r\n")
}
@Html.Raw("     public " + item.AttrType + " " + item.ColumnName + "{get;set;}\r\n")
            }
        }
    }
}
